<?php

class wms_finder_deliverynote
{

	var $column_edit = '操作';
	var $column_edit_width = "100";

    var $detail_deliverynote_line="送货单行";
    // var $detail_deliverynote_ax="AX订单号";


	 public function column_edit($row)
	 {

	 	$finder_id = $_GET['_finder']['finder_id'];
	 	return '<a href="index.php?app=wms&ctl=admin_deliverynote&act=deliedit&id=' . $row['id'] . '&finder_id='.$finder_id.'" target="_blank">编辑</a>';
	 }

    /*
     * 备货通知单明细
     */
    function detail_deliverynote_line($row){
        $render = app::get('wms')->render();
        $deliverynote_line = app::get('wms')->model('deliverynote_line');
        $dlyObj = app::get('wms')->model('delivery');
        $omeExtOrdLib = kernel::single('ome_extint_order');

        $basicMaterialInfo = $deliverynote_line->getList('*', array('deliverynote_id' => $row));

        foreach ($basicMaterialInfo as $key => $value) {
            $dly = $dlyObj->dump($value['delivery_id'],'outer_delivery_bn');
            $order_bns = $omeExtOrdLib->getOrderBns($dly['outer_delivery_bn']);
            $order_bn = array_values($order_bns);
            $basicMaterialInfo[$key]['order_bn'] = $order_bn[0];
        }
        $render->pagedata['res'] = $basicMaterialInfo;
        return $render->fetch('admin/deliverynote/deliverynote_line.html');
    }
    // /*
    //  * 备货通知单明细
    //  */
    // function detail_deliverynote_ax($row){
    //     $render = app::get('wms')->render();
    //     $deliverynote_line = app::get('wms')->model('deliverynote_ax');
    //     $basicMaterialInfo = $deliverynote_line->getList('*', array('deliverynote_id' => $row));
    //     $render->pagedata['res'] = $basicMaterialInfo;
    //     return $render->fetch('admin/deliverynote/deliverynote_ax.html');
    // }

}